﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using MiniScrum.Models;

namespace MiniScrum.Controllers
{
    public class ScrumSummaryController : Controller
    {

        public ActionResult CreateTask()
        {
            return View("CreateTask");
        }
        [HttpPost]
        public ActionResult CreateTask(Task task)
        {
            try
            {
                Task.Create(task);
                return RedirectToAction("UserScrumSummary");
            }
            catch (Exception)
            {

                throw;
            }
        }

        public ActionResult UserScrumSummary()
        {
            MiniScrum.Models.User user = (System.Threading.Thread.CurrentPrincipal as MiniScrum.Models.User);
            return View(ScrumSummary.GetTodayDetails(user.Id));
        }

        public ActionResult List()
        {
            return View(ScrumSummary.GetAllDetails());
        }

    }
}
